<template>
  <section class="bgff p20" style="min-height:100%;">
    <section>
			<el-form :inline="true" :model="formInline" class="demo-form-inline">
				<el-form-item label="审批人">
					<el-input v-model="formInline.user" placeholder="审批人"></el-input>
				</el-form-item>
				<el-form-item label="活动区域">
					<el-select v-model="formInline.region" placeholder="活动区域">
						<el-option label="区域一" value="shanghai"></el-option>
						<el-option label="区域二" value="beijing"></el-option>
					</el-select>
				</el-form-item>
				
				<el-form-item>
					<el-button type="primary" @click="onSubmit">查询</el-button>
				</el-form-item>
			</el-form>
    </section>
		<section>
			<tree-table :data="dataTree" row-key="id"    :expandAll="true" :columns="columns" size="small">
				<el-table-column prop="createTime" label="创建日期">
					<template slot-scope="scope">
						<span>{{ parseTime(scope.row.createTime) }}</span>
					</template>
				</el-table-column>
				<el-table-column label="操作" width="150px" align="center">
							<el-button slot="reference" type="danger" size="mini">删除</el-button>
					<el-button slot="reference" type="danger" size="mini">编辑</el-button>
				</el-table-column>
			</tree-table>
		</section>
  </section>
</template>

<script>
import treeTable from '@/components/TreeTable'
import { parseTime } from '@/utils/index'
export default {
	components: {treeTable},
  data() {
    return {
      formInline: {
        user: "",
        region: ""
	  },
	 
		value1: '',
		dataTree:[{
								"id": 2,
								"name": "USER_ALL",
								"pid": 0,
								"alias": "用户管理",
								"createTime": 1543811299000,
								"children": [{
									"id": 1,
									"name": "ADMIN",
									"pid": 2,
									"alias": "超级管理员",
									"createTime": 1543811268000,
									"children": null
								}, {
									"id": 3,
									"name": "USER_SELECT",
									"pid": 2,
									"alias": "用户查询",
									"createTime": 1543811495000,
									"children": null
								}, {
									"id": 4,
									"name": "USER_CREATE",
									"pid": 2,
									"alias": "用户创建",
									"createTime": 1543811495000,
									"children": null
								}, {
									"id": 5,
									"name": "USER_EDIT",
									"pid": 2,
									"alias": "用户编辑",
									"createTime": 1543811495000,
									"children": null
								}, {
									"id": 6,
									"name": "USER_DELETE",
									"pid": 2,
									"alias": "用户删除",
									"createTime": 1543811495000,
									"children": null
								}]
							}, {
								"id": 7,
								"name": "ROLES_ALL",
								"pid": 0,
								"alias": "角色管理",
								"createTime": 1543811299000,
								"children": [{
									"id": 8,
									"name": "ROLES_SELECT",
									"pid": 7,
									"alias": "角色查询",
									"createTime": 1543811495000,
									"children": null
								}, {
									"id": 10,
									"name": "ROLES_CREATE",
									"pid": 7,
									"alias": "角色创建",
									"createTime": 1544357416000,
									"children": null
								}, {
									"id": 11,
									"name": "ROLES_EDIT",
									"pid": 7,
									"alias": "角色编辑",
									"createTime": 1544357442000,
									"children": null
								}, {
									"id": 12,
									"name": "ROLES_DELETE",
									"pid": 7,
									"alias": "角色删除",
									"createTime": 1544357467000,
									"children": null
								}]
							}],
					
				columns:[
									{
										text: '名称',
										value: 'name'
									},
									{
										text: '别名',
										value: 'alias'
									}
								],
						
    };
  },
  methods: {
		parseTime,
    onSubmit() {
      console.log("submit!");
    }
  }
};
</script>

<style lang="less">
</style>
